﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:c="clr-namespace:personalplaner.common.controls"
                    xmlns:p="clr-namespace:personalplaner.common.Properties"
                    xmlns:shell="http://schemas.microsoft.com/winfx/2006/xaml/presentation/shell"
                    xmlns:sys="clr-namespace:System;assembly=mscorlib"
                    xmlns:k="clr-namespace:personalplaner.common.themes">

    <ResourceDictionary.MergedDictionaries>
        <!--<ResourceDictionary Source="/personalplaner.common;component/resources/TabControlStyles.xaml"/>-->
        <ResourceDictionary Source="/personalplaner.common;component/resources/styles/WhiteStyleTemplates.xaml"/>
    </ResourceDictionary.MergedDictionaries>
    
    <!-- ************************************************************** -->
    <!-- Styles                                                         -->
    <!-- ************************************************************** -->
    <Style TargetType="{x:Type TextBlock}" x:Key="WrappingStyle">
        <Setter Property="TextWrapping" Value="Wrap"/>
        <Setter Property="FontSize" Value="13"/>
        <!--<Setter Property="FontWeight" Value="Thin"/>-->
    </Style>

    <Style x:Key="SimpleNoBorderButtonStyle" TargetType="{x:Type Button}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Button}">
                    <Border x:Name="NoBorder_HeaderCommandIntBorder" Background="Transparent" BorderBrush="Transparent" BorderThickness="1" CornerRadius="2" Margin="0" Opacity="0.8">
                        <ContentPresenter ContentSource="Content"/>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter TargetName="NoBorder_HeaderCommandIntBorder" Property="Opacity" Value="1"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- ************************************************************** -->
    <!-- Template for MessageBox                                        -->
    <!-- ************************************************************** -->
    <Style TargetType="{x:Type c:MessageBoxExt}">

        <Setter Property="BorderBrush" Value="Black"/>
        <Setter Property="AllowsTransparency" Value="true"/>
        <Setter Property="WindowStyle" Value="None"/>
        <Setter Property="shell:WindowChrome.WindowChrome">
            <Setter.Value>
                <shell:WindowChrome ResizeBorderThickness="6" CornerRadius="0" CaptionHeight="17" GlassFrameThickness="0"/>
            </Setter.Value>
        </Setter>
        
        
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="Title" Value="{Binding Title}"/>
        <Setter Property="SizeToContent" Value="WidthAndHeight" />
        <!--<Setter Property="Width" Value="600"/>-->

        <Setter Property="MaxWidth" Value="600"/>
        <Setter Property="FontSize" Value="12"/>
        <Setter Property="ResizeMode" Value="NoResize"/>
        <Setter Property="ShowInTaskbar" Value="False"/>
        <Setter Property="Foreground" Value="#E1000000"/>
        <Setter Property="Background">
            <Setter.Value>
                <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
                    <LinearGradientBrush.GradientStops>
                        <GradientStop Color="White" Offset="0"/>
                        <GradientStop Color="White" Offset="0.6"/>
                        <GradientStop Color="#FFEDEDED" Offset="1"/>
                    </LinearGradientBrush.GradientStops>
                </LinearGradientBrush>
            </Setter.Value>
        </Setter>
        <!--<Setter Property="Background" Value="#F0F0F0"/>-->
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type c:MessageBoxExt}">
                    <AdornerDecorator>
                        <Grid>
                            <!--<Border Background="Black" Margin="6">
                                <Border.Effect>
                                    <BlurEffect Radius="15" />
                                </Border.Effect>
                            </Border>-->

                            <Border BorderBrush="Black" BorderThickness="1" >
                                <Grid Background="{TemplateBinding Background}">

                                    <Grid Margin="10,30,10,10">
                                        <Grid.RowDefinitions>
                                            <RowDefinition MinHeight="80" Height="Auto"/>
                                            <RowDefinition Height="Auto"/>
                                        </Grid.RowDefinitions>
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="Auto"/>
                                            <ColumnDefinition />
                                        </Grid.ColumnDefinitions>

                                        <Image x:Name="Image" Source="/personalplaner.common;component/resources/images/Symbol Information.png" Margin="20,0,0,10" Visibility="Collapsed" Width="32" Height="32" />

                                        <ContentPresenter Grid.Row="0" Grid.Column="1" Content="{TemplateBinding MessageBoxContent}" VerticalAlignment="Center" Margin="20,20,20,30">
                                            <ContentPresenter.Resources>
                                                <Style TargetType="{x:Type TextBlock}" BasedOn="{StaticResource WrappingStyle}"/>
                                            </ContentPresenter.Resources>
                                        </ContentPresenter>

                                        <StackPanel Grid.Row="1" Grid.ColumnSpan="2" Orientation="Horizontal" HorizontalAlignment="Right">

                                            <Button x:Name="PART_ButtonYes" Visibility="Collapsed" MinWidth="60" Margin="5" >
                                                <TextBlock Text="{x:Static p:Resources.Yes}"/>
                                            </Button>

                                            <Button x:Name="PART_ButtonNo" Visibility="Collapsed" MinWidth="60" Margin="5" >
                                                <TextBlock Text="{x:Static p:Resources.No}"/>
                                            </Button>

                                            <Button x:Name="PART_ButtonOk" Visibility="Collapsed" MinWidth="60" Margin="5" >
                                                <TextBlock Text="{x:Static p:Resources.Ok}"/>
                                            </Button>

                                            <Button x:Name="PART_ButtonCancel" IsCancel="True" Visibility="Collapsed" MinWidth="60" Margin="5" >
                                                <TextBlock Text="{x:Static p:Resources.Cancel}"/>
                                            </Button>
                                        </StackPanel>
                                    </Grid>


                                    <!-- Title -->
                                    <Grid VerticalAlignment="Top" Margin="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(shell:WindowChrome.WindowChrome).ResizeBorderThickness}" Opacity="0.6" >
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="Auto"/>
                                            <ColumnDefinition/>
                                        </Grid.ColumnDefinitions>
                                        <Border Margin="-5,-5,-5,-3" Background="#DDDDDD" Grid.ColumnSpan="2" BorderBrush="#DD000000" BorderThickness="0,0,0,1"/>
                                        <TextBlock Text="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Title}" FontWeight="Heavy" Foreground="{TemplateBinding Foreground}" HorizontalAlignment="Center" VerticalAlignment="Top" Margin="0,-3,0,0"/>
                                    </Grid>

                                    <!-- Buttons in the Header -->
                                    <StackPanel Orientation="Horizontal" VerticalAlignment="Top" HorizontalAlignment="Right" Margin="0,0,0,0" x:Name="MainGrid" Opacity="0.8">
                                        <Button shell:WindowChrome.IsHitTestVisibleInChrome="True" Command="{x:Static shell:SystemCommands.MinimizeWindowCommand}" Style="{StaticResource SimpleNoBorderButtonStyle}" Margin="3,8,2,0" x:Name="PART_MinimizeButton">
                                            <Path Data="M 0,6 L 8,6" Stroke="{TemplateBinding Foreground}" SnapsToDevicePixels="True" StrokeThickness="2" VerticalAlignment="Center"/>
                                        </Button>
                                        <Button shell:WindowChrome.IsHitTestVisibleInChrome="True" Command="{x:Static shell:SystemCommands.RestoreWindowCommand}" Style="{StaticResource SimpleNoBorderButtonStyle}" Margin="3,8,2,0" x:Name="PART_RestoreButton" Visibility="Collapsed">
                                            <Grid>
                                                <Path Data="M 2,0 L 8,0 L 8,6 L 2,6 Z" Stroke="{TemplateBinding Foreground}" SnapsToDevicePixels="True" VerticalAlignment="Center"/>
                                                <Path Data="M 0,3 L 6,3 L 6,8 L 0,8 Z" Stroke="{TemplateBinding Foreground}" SnapsToDevicePixels="True" VerticalAlignment="Center" StrokeThickness="2"/>
                                            </Grid>
                                        </Button>

                                        <Button shell:WindowChrome.IsHitTestVisibleInChrome="True" Command="{x:Static shell:SystemCommands.MaximizeWindowCommand}" Style="{StaticResource SimpleNoBorderButtonStyle}" Margin="3,8,2,0" x:Name="PART_MaxButton">
                                            <Path Data="M 0,0 L 8,0 L 8,7 L 0,7 Z M 0,1 L 8,1 M 0,2 L 8,2" Stroke="{TemplateBinding Foreground}" SnapsToDevicePixels="True" VerticalAlignment="Center"/>
                                        </Button>
                                        <Button shell:WindowChrome.IsHitTestVisibleInChrome="True" Command="{x:Static shell:SystemCommands.CloseWindowCommand}" Style="{StaticResource SimpleNoBorderButtonStyle}" Margin="3,5,5,0">
                                            <Path Data="M 0,0 L 8,8 M 8,0 L 0,8" Stroke="{TemplateBinding Foreground}" SnapsToDevicePixels="True" VerticalAlignment="Center"/>
                                        </Button>
                                    </StackPanel>
                                </Grid>

                            </Border>
                        </Grid>
                    </AdornerDecorator>

                    <ControlTemplate.Triggers>

                        <DataTrigger Binding="{Binding Path=WindowState, RelativeSource={RelativeSource AncestorType={x:Type c:WindowExt}}}" Value="Maximized">
                            <Setter TargetName="PART_MaxButton" Property="Visibility" Value="Collapsed"/>
                            <Setter TargetName="PART_RestoreButton" Property="Visibility" Value="Visible"/>
                            <Setter Property="BorderThickness" Value="{Binding Source={x:Static shell:SystemParameters2.Current}, Path=WindowResizeBorderThickness}"/>
                            <Setter TargetName="MainGrid" Property="Margin" Value="0,5,0,0"/>
                        </DataTrigger>
                        <!--<DataTrigger Binding="{Binding Path=ResizeMode, RelativeSource={RelativeSource AncestorType={x:Type c:WindowExt}}}" Value="NoResize">
                            <Setter TargetName="PART_MaxButton" Property="Visibility" Value="Collapsed"/>
                            <Setter TargetName="PART_RestoreButton" Property="Visibility" Value="Collapsed"/>
                            <Setter TargetName="PART_MinimizeButton" Property="Visibility" Value="Collapsed"/>
                        </DataTrigger>-->
                        <Trigger Property="ResizeMode" Value="NoResize">
                            <Setter TargetName="PART_MaxButton" Property="Visibility" Value="Collapsed"/>
                            <Setter TargetName="PART_RestoreButton" Property="Visibility" Value="Collapsed"/>
                            <Setter TargetName="PART_MinimizeButton" Property="Visibility" Value="Collapsed"/>
                        </Trigger>




                        <!-- Buttons -->
                        <Trigger Property="MessageBoxButton" Value="YesNoCancel">
                            <Setter TargetName="PART_ButtonYes" Property="Visibility" Value="Visible"/>
                            <Setter TargetName="PART_ButtonNo" Property="Visibility" Value="Visible"/>
                            <Setter TargetName="PART_ButtonCancel" Property="Visibility" Value="Visible"/>
                            <Setter TargetName="PART_ButtonYes" Property="IsDefault" Value="True"/>
                        </Trigger>
                        <Trigger Property="MessageBoxButton" Value="YesNo">
                            <Setter TargetName="PART_ButtonYes" Property="Visibility" Value="Visible"/>
                            <Setter TargetName="PART_ButtonNo" Property="Visibility" Value="Visible"/>
                            <Setter TargetName="PART_ButtonYes" Property="IsDefault" Value="True"/>
                        </Trigger>
                        <Trigger Property="MessageBoxButton" Value="OkCancel">
                            <Setter TargetName="PART_ButtonOk" Property="Visibility" Value="Visible"/>
                            <Setter TargetName="PART_ButtonCancel" Property="Visibility" Value="Visible"/>
                            <Setter TargetName="PART_ButtonOk" Property="IsDefault" Value="True"/>
                        </Trigger>
                        <Trigger Property="MessageBoxButton" Value="Ok">
                            <Setter TargetName="PART_ButtonOk" Property="Visibility" Value="Visible"/>
                            <Setter TargetName="PART_ButtonOk" Property="IsDefault" Value="True"/>
                        </Trigger>

                        <!-- Images -->
                        <Trigger Property="MessageBoxImage" Value="Asterisk">
                            <Setter TargetName="Image" Property="Source" Value="/personalplaner.common;component/resources/images/Symbol Information.png"/>
                            <Setter TargetName="Image" Property="Visibility" Value="Visible"/>
                        </Trigger>
                        <Trigger Property="MessageBoxImage" Value="Error">
                            <Setter TargetName="Image" Property="Source" Value="/personalplaner.common;component/resources/images/Symbol Delete.png"/>
                            <Setter TargetName="Image" Property="Visibility" Value="Visible"/>
                        </Trigger>
                        <Trigger Property="MessageBoxImage" Value="Exclamation">
                            <Setter TargetName="Image" Property="Source" Value="/personalplaner.common;component/resources/images/Symbol Warning.png"/>
                            <Setter TargetName="Image" Property="Visibility" Value="Visible"/>
                        </Trigger>
                        <Trigger Property="MessageBoxImage" Value="Hand">
                            <Setter TargetName="Image" Property="Source" Value="/personalplaner.common;component/resources/images/Symbol Delete.png"/>
                            <Setter TargetName="Image" Property="Visibility" Value="Visible"/>
                        </Trigger>
                        <Trigger Property="MessageBoxImage" Value="Information">
                            <Setter TargetName="Image" Property="Source" Value="/personalplaner.common;component/resources/images/Symbol Information.png"/>
                            <Setter TargetName="Image" Property="Visibility" Value="Visible"/>
                        </Trigger>
                        <Trigger Property="MessageBoxImage" Value="Question">
                            <Setter TargetName="Image" Property="Source" Value="/personalplaner.common;component/resources/images/Symbol Help.png"/>
                            <Setter TargetName="Image" Property="Visibility" Value="Visible"/>
                        </Trigger>
                        <Trigger Property="MessageBoxImage" Value="Stop">
                            <Setter TargetName="Image" Property="Source" Value="/personalplaner.common;component/resources/images/Symbol Delete.png"/>
                            <Setter TargetName="Image" Property="Visibility" Value="Visible"/>
                        </Trigger>
                        <Trigger Property="MessageBoxImage" Value="Warning">
                            <Setter TargetName="Image" Property="Source" Value="/personalplaner.common;component/resources/images/Symbol Warning.png"/>
                            <Setter TargetName="Image" Property="Visibility" Value="Visible"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    
</ResourceDictionary>